package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.entity.AlertData;
import com.zzyl.mapper.AlertDataMapper;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class AlertDataServiceImpl implements AlertDataService {

    @Autowired
    private AlertDataMapper alertDataMapper;

    @Override
    public PageResponse pageQuery(Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        Page<AlertDataVo> alertDataVos = alertDataMapper.pageQuery();
        return PageResponse.of(alertDataVos, AlertDataVo.class);
    }
}
